package com.back.campus_back.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class UploadConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //映射图片保存地址
        try {
            registry.addResourceHandler("/img/**").addResourceLocations("classpath:/static/img");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
